package com.myajax;

import java.sql.*;

public class RetriveData {
	String str;
	RetriveData(String str){
		this.str=str;
	}

	ResultSet retrive() throws ClassNotFoundException, SQLException{
		String driverClassName="com.mysql.jdbc.Driver";
		String url="jdbc:mysql://localhost:3306/mydatabase";
		String uname="root";
		String pass="";
		//load driver class:
		Class.forName(driverClassName);
		Connection con =DriverManager.getConnection(url,uname,pass);
		Statement st = con.createStatement();
		String query="SELECT * FROM  `emp_master` WHERE name =  '"+str+"'";
		ResultSet rs= st.executeQuery(query);
		return rs;
		
	}
}
